<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>条件渲染</title>
  <style>

  </style>
</head>

<body>
  <div id="app">
    <h1>{{msg}}</h1>
    <hr>
    <h3 v-if="isLogin">"isLogin: " {{isLogin}}</h3>
    <h3 v-else-if="isEat" v-text="msg"></h3>
    <h3 v-else>"isDrink: " {{ isDrink}}</h3>

    <div>
      <h2 v-if="isDrink">v-show 案例</h2>
    </div>

    <div>
      <h2 v-show="isDrink">v-show 案例: DOM节点已经创建并挂载到页面， 当变量值为假时，就使用display:none；来隐藏元素。</h2>
    </div>

    <!-- <h3 v-if="isEat" v-text="msg">{{msg}}</h3> -->
  </div>


  <script src="./js/vue.js"></script>
  <script>

    var vm = new Vue( {
      el: "#app", // vm 挂载到哪一个DOM节点上面
      data: {
        msg: '条件渲染代码',
        isLogin: false,
        isEat: true,
        isDrink: true,
      }
    } );

  </script>
</body>

</html>